package qimao.com.edu.entity;

import jakarta.persistence.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 作者信息表
 * @author 86173
 *
 */
//@Entity
//@Table(name = "author")
public class Author {
	/**
	 * 用户id
	 */
//    @Id
//    @Column(name = "author_id")
    private Integer authorId;
    /**
	 * 账号名
	 */
//    @Column(name = "username", nullable = false, length = 50, unique = true)
    private String username;
    /**
	 * 密码
	 */
//    @Column(name = "password", nullable = false, length = 100)
    private String password;
    /**
	 * 角色
	 */
//    @Column(name = "roleName",nullable = false,columnDefinition = "VARCHAR(100) DEFAULT 'author'")
    private String roleName;
    /**
     * 笔名
     */
//    @Column(name = "pen_name", nullable = false, length = 50, unique = true)
    private String penName;
    
    /**
     * 真实姓名
     */
//    @Column(name = "real_name", length = 50)
    private String realName;
    
    /**
     * 性别
     */
//    @Column(name = "gender", length = 50)
    private String gender;

    /**
	 * 头像
	 */
//    @Column(name = "avatar", length = 255)
    private String avatar;
    /**
	 * 生日
	 */
//    @Column(name = "birthday")
    private LocalDateTime birthday;
    /**
     * 出生地
     */
//    @Column(name = "birth_place", length = 100)
    private String birthPlace;
    
    /**
     * 个人简介
     */
//    @Column(name = "bio", columnDefinition = "TEXT")
    private String bio;
    
    /**
     * 作品数量
     */
//    @Column(name = "works_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer worksCount;
    /**
     * 注册时间
     */
//    @Column(name = "register_time", nullable = false)
    private LocalDateTime registerTime;
    
    /**
     * 账号状态：0-禁用，1-正常
     */
    
//    @Column(name = "status", nullable = false, columnDefinition = "TINYINT DEFAULT 1")
    private Integer status; // 0-禁用，1-正常

	public Author() {
		super();
	}

	public Author(Integer authorId, String username, String password, String roleName, String penName, String realName,
			String gender, String avatar, LocalDateTime birthday, String birthPlace, String bio, Integer worksCount,
			LocalDateTime registerTime, Integer status) {
		super();
		this.authorId = authorId;
		this.username = username;
		this.password = password;
		this.roleName = roleName;
		this.penName = penName;
		this.realName = realName;
		this.gender = gender;
		this.avatar = avatar;
		this.birthday = birthday;
		this.birthPlace = birthPlace;
		this.bio = bio;
		this.worksCount = worksCount;
		this.registerTime = registerTime;
		this.status = status;
	}

	public Integer getAuthorId() {
		return authorId;
	}

	public void setAuthorId(Integer authorId) {
		this.authorId = authorId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getPenName() {
		return penName;
	}

	public void setPenName(String penName) {
		this.penName = penName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public LocalDateTime getBirthday() {
		return birthday;
	}

	public void setBirthday(LocalDateTime birthday) {
		this.birthday = birthday;
	}

	public String getBirthPlace() {
		return birthPlace;
	}

	public void setBirthPlace(String birthPlace) {
		this.birthPlace = birthPlace;
	}

	public String getBio() {
		return bio;
	}

	public void setBio(String bio) {
		this.bio = bio;
	}

	public Integer getWorksCount() {
		return worksCount;
	}

	public void setWorksCount(Integer worksCount) {
		this.worksCount = worksCount;
	}

	public LocalDateTime getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(LocalDateTime registerTime) {
		this.registerTime = registerTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Author [authorId=" + authorId + ", username=" + username + ", password=" + password + ", roleName="
				+ roleName + ", penName=" + penName + ", realName=" + realName + ", gender=" + gender + ", avatar="
				+ avatar + ", birthday=" + birthday + ", birthPlace=" + birthPlace + ", bio=" + bio + ", worksCount="
				+ worksCount + ", registerTime=" + registerTime + ", status=" + status + "]";
	}

}
